/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.common.i;

import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class h {
    public static void a(InputStream paramInputStream) {
        a(paramInputStream);
    }

    public static void a(OutputStream paramOutputStream) {
        a(paramOutputStream);
    }

    public static void a(Closeable paramCloseable) {
        try {
            if (paramCloseable != null)
                paramCloseable.close();
        } catch (IOException localIOException) {}
    }

    public static int a(InputStream paramInputStream, OutputStream paramOutputStream) {
        long l = b(paramInputStream, paramOutputStream);
        if (l > 2147483647L)
            return -1;
        return (int) l;
    }

    public static long b(InputStream paramInputStream, OutputStream paramOutputStream) {
        byte[] arrayOfByte = new byte[4096];
        long l = 0L;
        int i = 0;
        while (-1 != (i = paramInputStream.read(arrayOfByte))) {
            paramOutputStream.write(arrayOfByte, 0, i);
            l += i;
        }
        return l;
    }
}